﻿<?php
require_once('konfiguration.html');
$files=array("latin_german"=>"woerterbuch latein deutsch.txt");
foreach ($files as $key=> $value)
{
   $lines=file($value);
   print "$key";
   foreach($lines as $line)
   { 
  
      
      preg_match_all('/^(.*?)=(.*)/',$line,$matches,PREG_PATTERN_ORDER);
      $word=$matches[1][0];
      $translations=preg_split('/[=]/',$matches[2][0] );
      
	print  $matches[2][0].'<BR>';
      
     // print_r($matches);
      print_r($translations);
      
      if ($word and $index<=25502) 
      {
      foreach ($translations as $translation) 
      { 
         if ($translation[-1]=='/') $translation= substr  (  $translation  ,  0  ,-1 );
	 $translation=trim($translation);
        mysql_query("INSERT INTO alltranslations2 (language_combo, word, translation) VALUES ('$key','$word',
       '$translation')");
       
       
      }
      }
         
       $index+=1;
       set_time_limit(10);
      }
      
   

}


?>